package top.malegod.service;

import com.alipay.api.AlipayApiException;
import top.malegod.model.Alipay;

import java.util.Map;

/**
 * Create by IntelliJ IDEA
 *
 * @author: AbelEthan
 * @date-Time: 2018/5/24 21:33
 * @description: 支付宝service接口
 */
public interface AlipayService {


    /**
     * 交易关闭service层操作
     * @param outTradeNo
     * @param tradeNo
     * @return
     * @throws AlipayApiException
     */
    String close(String outTradeNo, String tradeNo) throws AlipayApiException;

    /**
     * 查询对账单下载地址service层操作
     * @param billType
     * @param billDate
     * @return
     * @throws AlipayApiException
     */
    String downloadUrl(String billType, String billDate) throws AlipayApiException;

    /**
     * 付款service层操作
     * @param alipay
     * @return
     * @throws AlipayApiException
     */
    String pay(Alipay alipay) throws AlipayApiException;

    /**
     * 交易查询service层操作
     * @param outTradeNo
     * @param tradeNo
     * @return
     * @throws AlipayApiException
     */
    String query(String outTradeNo, String tradeNo) throws AlipayApiException;

    /**
     * 退款service层操作
     * @param alipay
     * @return
     * @throws AlipayApiException
     */
    String refund(Alipay alipay) throws AlipayApiException;

    /**
     * 退款交易查询service层操作
     * @param alipay
     * @return
     * @throws AlipayApiException
     */
    String refundQuery(Alipay alipay) throws AlipayApiException;

    /**
     * 获取支付宝GET过来反馈信息service层操作
     * @param params
     * @throws AlipayApiException
     */
    void returnUrl(Map<String, String> params) throws AlipayApiException;

    /**
     * 获取支付宝POST过来反馈信息service层操作
     * @param params
     * @param tradeStatus
     * @throws AlipayApiException
     */
    String notifyUrl(Map<String, String> params, String tradeStatus) throws AlipayApiException;
}